package com.exposit.books.dao;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.exposit.books.domain.Buyer;

@Repository
@Transactional
public class BuyerDAOImpl extends AbstractDAOImpl<Buyer, Long> implements BuyerDAO  {

	@Override
	public Buyer getBuyerByLogin(String login) {		
        Query q = getSession().createQuery("from Buyer where login = :login");
        q.setString("login", login);
        return (Buyer) q.uniqueResult();	
	}

}
